#include <wdg.h>
#include <sys.h>

//30~60kHz
//分频系数：4*2^pr
void IWDG_Init(unsigned char pr, unsigned short rl)
{
	IWDG->KR = 0x5555;
	while(IWDG->SR & 0x0003);
	IWDG->PR = pr;
	IWDG->RLR = rl;
	//下面这句是为啥呢，以防万一？
	IWDG->KR = 0xAAAA;
	IWDG->KR = 0xCCCC;
}

/*void WWDG_Init(unsigned char pr, unsigned short rl)
{
	WWDG->
}
*/
